package org.br.erp.rfq.po.entity;

import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.Entity;
import javax.persistence.Id;
import java.io.UnsupportedEncodingException;

/**
 * @Description: 采购附件
 * @Author: jeecg-boot
 * @Date:   2023-09-26
 * @Version: V1.0
 */
@ApiModel(value="scmpoattach对象", description="采购附件")
@Data
@TableName("scmpoattach")
@Entity
public class Scmpoattach implements Serializable {
    private static final long serialVersionUID = 1L;

	/**主键*/
	@TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    @Id
    private java.lang.String id;
	/**parentid*/
    @ApiModelProperty(value = "parentid")
    private java.lang.String parentid;
	/**发货图片*/
	@Excel(name = "发货图片", width = 15)
    private transient java.lang.String deliveryimgString;

    private byte[] deliveryimg;

    public byte[] getDeliveryimg(){
        if(deliveryimgString==null){
            return null;
        }
        try {
            return deliveryimgString.getBytes("UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return null;
    }

    public String getDeliveryimgString(){
        if(deliveryimg==null || deliveryimg.length==0){
            return "";
        }
        try {
            return new String(deliveryimg,"UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return "";
    }
	/**附件*/
	@Excel(name = "附件", width = 15)
    private transient java.lang.String attachidString;

    private byte[] attachid;

    public byte[] getAttachid(){
        if(attachidString==null){
            return null;
        }
        try {
            return attachidString.getBytes("UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return null;
    }

    public String getAttachidString(){
        if(attachid==null || attachid.length==0){
            return "";
        }
        try {
            return new String(attachid,"UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return "";
    }
}
